/* 内联样式简化示例，实际可放入coupons.css */
.coupons-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.coupons-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 24px;
}

h2 {
    font-size: 24px;
    color: #333;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.coupon-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.coupon-item {
    display: flex;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    background: linear-gradient(135deg, #fff 0%, #f9f9f9 100%);
    position: relative;
}

.coupon-item:hover {
    transform: translateY(-5px);
}

.coupon-value {
    background: linear-gradient(135deg, #ff5e62 0%, #ff9966 100%);
    color: white;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-width: 80px;
}

.coupon-value span {
    font-size: 28px;
    font-weight: bold;
}

.coupon-details {
    padding: 16px;
    flex-grow: 1;
}

.coupon-details h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #333;
}

.coupon-condition {
    font-size: 14px;
    color: #666;
    margin: 8px 0;
}

.coupon-expiry {
    font-size: 12px;
    color: #999;
    margin: 8px 0;
}

.coupon-remaining {
    font-size: 12px;
    color: #ff5e62;
    font-weight: bold;
}

.coupon-status {
    position: absolute;
    top: 10px;
    right: 10px;
}

.status-tag {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: bold;
}

.status-available {
    background-color: #e3f7e8;
    color: #00a854;
}

.status-used {
    background-color: #f0f0f0;
    color: #999;
}

.status-expired {
    background-color: #fff2f0;
    color: #f5222d;
}

.no-coupons-message {
    text-align: center;
    padding: 40px 0;
}

.no-coupons-message p {
    font-size: 16px;
    color: #666;
    margin-bottom: 20px;
}

.no-coupons-message a {
    display: inline-block;
    padding: 10px 24px;
    background: linear-gradient(135deg, #ff5e62 0%, #ff9966 100%);
    color: white;
    text-decoration: none;
    border-radius: 24px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.no-coupons-message a:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 94, 98, 0.3);
}

.loading-indicator {
    text-align: center;
    padding: 40px 0;
    color: #666;
}

.error-message {
    text-align: center;
    padding: 20px;
    background: #fff2f0;
    color: #f5222d;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* 优惠券选择模态框内部样式 */
.coupon-selection-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px; /* 限制高度并允许滚动 */
    overflow-y: auto;
    padding-right: 5px; /* 防止滚动条遮挡内容 */
}

.coupon-item-selectable {
    display: flex;
    align-items: center;
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 10px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.coupon-item-selectable:hover {
    background-color: #e6f7ff;
    border-color: #91d5ff;
}

.coupon-item-selectable.selected {
    background-color: #e6f7ff;
    border-color: #40a9ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.coupon-item-selectable .coupon-value {
    background: none; /* 移除背景色，与模态框整体风格保持一致 */
    color: #ff5e62;
    font-size: 1.1rem;
    min-width: 60px;
    padding: 0;
    margin-right: 15px;
}

.coupon-item-selectable .coupon-value span {
    font-size: 1.8rem;
}

.coupon-item-selectable .coupon-details {
    flex-grow: 1;
    padding: 0; /* 调整内边距 */
}

.coupon-item-selectable .coupon-details h3 {
    font-size: 15px;
    margin-bottom: 5px;
}

.coupon-item-selectable .coupon-condition,
.coupon-item-selectable .coupon-expiry {
    font-size: 0.85rem;
    margin-bottom: 2px;
}

.coupon-actions {
    margin-left: auto;
}

.btn-select-coupon {
    background-color: #007bff; /* 蓝色 */
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
}

.btn-select-coupon:hover {
    background-color: #0056b3;
}

.selected-icon {
    color: #28a745; /* 绿色 */
    font-size: 1.5rem;
    margin-left: 10px;
}

.modal-footer {
    padding-top: 15px;
    border-top: 1px solid #eee;
    margin-top: 20px;
    text-align: center;
}

.btn-clear-coupon {
    background-color: #f0f0f0;
    color: #666;
    border: 1px solid #ddd;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.btn-clear-coupon:hover {
    background-color: #e0e0e0;
    border-color: #bbb;
}

.btn-select-coupon-main {
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-select-coupon-main:hover {
    background-color: #e0e0e0;
    border-color: #bbb;
}

/* 弹窗 */
/* 弹窗遮罩层，居中弹窗 */
.coupon-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 弹窗主体 */
.coupon-modal {
    background: #fff;
    border-radius: 12px;
    padding: 32px 28px 24px 28px;
    min-width: 350px;
    max-width: 90vw;
    box-shadow: 0 4px 24px rgba(0,0,0,0.18);
    position: relative;
    text-align: left;
    animation: popup-fade-in 0.3s;
}

/* 弹窗头部 */
.coupon-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.coupon-modal-header h3 {
    margin: 0;
    font-size: 1.3em;
    font-weight: bold;
}
.close-button {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #888;
    transition: color 0.2s;
}
.close-button:hover {
    color: #f56c6c;
}

/* 弹窗底部按钮 */
.coupon-modal-footer {
    text-align: right;
    margin-top: 18px;
}
.btn-primary {
    background: #ff9800;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 24px;
    font-size: 1em;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-primary:hover {
    background: #e67c00;
}

/* 优惠券内容样式（可根据管理页样式调整） */
.coupon-item {
    display: flex;
    align-items: center;
    background: #f7f7f7;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 10px;
}
.coupon-value {
    font-size: 2.2em;
    color: #ff9800;
    font-weight: bold;
    margin-right: 18px;
}
.coupon-details h3 {
    margin: 0 0 4px 0;
    font-size: 1.1em;
}
.coupon-condition, .coupon-expiry, .coupon-remaining {
    font-size: 0.95em;
    color: #666;
    margin: 2px 0;
}
.coupon-status {
    margin-left: auto;
}
.status-tag {
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.95em;
    background: #eee;
    color: #888;
}
.status-tag.active { background: #ff9800; color: #fff; }
.status-tag.used { background: #aaa; color: #fff; }
.status-tag.expired { background: #e57373; color: #fff; }

/* 弹窗动画 */
@keyframes popup-fade-in {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}